def calc(a,b):#
    return a+b
print(calc(10,20))

#匿名函数
s=lambda a,b:a+b
print(type(s))
#调用匿名函数
print(s(10,20))
print('-'*30)
#列表的正常操作
lst=[10,20,30,40,50]
for i in range(len(lst)):
    print(lst[i])
print('-'*30)

for i in range(len(lst)):
    result=lambda x:x[i]
    print(result(lst))

#
student_scores=[
    {'name':'李哲哲','score':80},
    {'name':'贾月月','score':90},
    {'name':'赵高高','score':95},
    {'name':'陈哈哈','score':65}
]

#对列表进行排序，规则是字典中成绩
student_scores.sort(key=lambda x:x.get('score'),reverse =True)
print(student_scores)
